﻿namespace MelodysDemo.Core.Models
{
    /// <summary>
    /// 问卷信息表
    /// </summary>
    [Table("survey_questionnaire")]
    public partial class SurveyQuestionnaire
    {
        public SurveyQuestionnaire()
        {
            SurveyClazzQuestionnaires = new HashSet<SurveyClazzQuestionnaire>();
            SurveyQuestions = new HashSet<SurveyQuestion>();
        }

        /// <summary>
        /// 自增主键
        /// </summary>
        [Key]
        [Column("id")]
        public long Id { get; set; }
        /// <summary>
        /// 问卷名称
        /// </summary>
        [Required]
        [Column("title")]
        [StringLength(256)]
        public string Title { get; set; }
        /// <summary>
        /// 问题数
        /// </summary>
        [Column("question_count")]
        public byte QuestionCount { get; set; }
        /// <summary>
        /// 总分
        /// </summary>
        [Column("total_score")]
        public short TotalScore { get; set; }
        /// <summary>
        /// 状态（0：待上架，1：已启用，2：已禁用）
        /// </summary>
        [Column("status")]
        public byte Status { get; set; }
        /// <summary>
        /// 版本号
        /// </summary>
        [Column("version")]
        public long Version { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        [Required]
        [Column("creator")]
        [StringLength(64)]
        public string Creator { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        [Column("modified_time")]
        public DateTime ModifiedTime { get; set; }
        /// <summary>
        /// 修改人
        /// </summary>
        [Required]
        [Column("modifier")]
        [StringLength(64)]
        public string Modifier { get; set; }
        /// <summary>
        /// 是否删除，0：否，1：是
        /// </summary>
        [Column("is_delete")]
        public byte IsDelete { get; set; }

        [InverseProperty("Questionnaire")]
        public virtual ICollection<SurveyClazzQuestionnaire> SurveyClazzQuestionnaires { get; set; }
        [InverseProperty("Questionnaire")]
        public virtual ICollection<SurveyQuestion> SurveyQuestions { get; set; }
    }
}